package com.hns.can.mainte.web;
import com.hns.can.common.web.BaseController;
import com.hns.can.mainte.entity.TCommGpsSwtcInfoEntity;
import com.hns.can.mainte.service.GpsSignalService;
import com.hns.can.mainte.vo.TCommGpsSwtcCountVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * GPS信号Controller
 * @author:zhangzq
 * @email:
 * @version Revision 2.0.0
 */
@Controller
@RequestMapping("/gpsSignal")
public class GpsSignalController extends BaseController {

    @Autowired
    private GpsSignalService gpsSignalService;

    /**
     * 查询投币机
     * @param beginTime
     * @param endTime
     * @param lineId
     * @return
     * @throws Exception
     * @author:zhangzq
     * @email:
     */
    @RequestMapping("/getGpsSwtcCount")
    @ResponseBody
    public Object getGpsSwtcCount(@RequestParam(value="beginTime")String beginTime, @RequestParam(value="endTime")String endTime, @RequestParam(value="lineId")String lineId) throws Exception {
        List<TCommGpsSwtcCountVo> list = gpsSignalService.getGpsSwtcCount(beginTime,endTime,lineId);
        return this.getReturnResult(list);
    }

    @RequestMapping("/getGpsSwtcListByCarId")
    @ResponseBody
    public Object getGpsSwtcListByCarId(@RequestParam(value="beginTime")String beginTime, @RequestParam(value="endTime")String endTime, @RequestParam(value="carId")String carId) throws Exception {
        List<TCommGpsSwtcInfoEntity> list = gpsSignalService.getGpsSwtcListByCarId(beginTime,endTime,carId);
        return this.getReturnResult(list);
    }
}
